<template>
  <view class="customer-service">
    <!-- 内容 -->
    <tabs
      :current="current"
      @change="handleChange"
      height="80"
      bar-width="60"
      :barStyle="{ bottom: '0' }"
    >
      <tab v-for="(item, i) in tabList" :key="i" :name="item.name">
        <view v-if="i == 0">
          123
          <!-- <component-list :cid="item.id" :i="i" :index="current">
          </component-list> -->
        </view>
        <view v-if="i == 1"> 123 </view>
      </tab>
    </tabs>
    <tabbar />
  </view>
</template>

<script setup lang="ts">
import { ref, reactive, computed } from "vue";
import { onLoad, onShow, onReady } from "@dcloudio/uni-app";
import ComponentList from "./component/component-list.vue";
//import { getDecorate } from "@/api/shop";

const tabList = ref<any>([]);
const current = ref<number>(0);

const handleChange = (index: number) => {
  console.log(index);
  current.value = Number(index);
};

const getData = async () => {
  const data = [{ name: "客户意向", id: 1 }];
  tabList.value = [{ name: "关联详情", id: 0 }].concat(data);
};

onLoad((options) => {
  getData();
});
</script>

<style lang="scss">
.customer-service {
  &-search {
    margin-bottom: 2rpx;
  }

  &-list {
    height: calc(100vh - 272rpx - env(safe-area-inset-bottom));
  }
}
</style>
